<?php
/**
 * @todo 安装程序
 * @copyright gaoxiang 2009
 * @author gaoxiang
 * @createdate 2009.05.05
 * @license 本程序遵照Creative Commons 署名-非商业性使用-相同方式共享 2.5 中国大陆 协议，该协议的中文版本可在http://creativecommons.org/licenses/by-nc-sa/2.5/cn/下查看。
 **/
 require_once(dirname(dirname(__FILE__)) . '/require/load.php');
 header('Cache-control: private, must-revalidate');
 check_user();
 if($_GET['action']=='prequery'){
    rogForm(date("Y-m-d"),date("Y-m-d"),0,0,0,0,0);
 }elseif($_GET['action']=='query'){
	 set_refer();
	 if(is_date($_POST['rbegin']) && is_date($_POST['rend']))
			login_echo($_SESSION['referer'],"日期错误，请重新填写");
	 if($_POST['rsupplier'] ！= '' && !is_char($_POST['rsupplier']))
			login_echo($_SESSION['referer'],"厂家代码错误，请重新填写");
 		rog_header("查询结果");
 		$database->fetch_rog($_POST['rbegin'],is_date($_POST['rend'],$_POST['rsupplier'],$_POST['rmake'],$_POST['rspec'],$_POST['rjudge'],0,0,0,0,0,0);
 }elseif($_GET['action']=='preinput'){
		prerog_edit();
 }elseif($_GET['action']=='input'){
		set_refer();
		if(!isset($_POST['preraw']) || !is_rog($_POST['preraw'])){
			login_echo($_SESSION['referer'],"请输入正确的原料批号");
		}
		if(!isset($_POST['prenum']) || !is_number($_POST['prenum'],1)){
			login_echo($_SESSION['referer'],"请输入正确的记录数");
		}
		rog_input($_POST['preraw'],$_POST['prenum']);
 }
 html_footer();
?>